/*
 * UAE - The Un*x Amiga Emulator
 *
 * disk support
 *
 * (c) 1995 Bernd Schmidt
 */

#pragma once

enum drive_type
{
    DRV_NONE= -1,
    DRV_35_DD= 0,
    DRV_35_HD,
    DRV_525_SD,
    DRV_35_DD_ESCOM
};

#define HISTORY_FLOPPY 0
#define HISTORY_CD 1

extern void DISK_init();
extern void DISK_free();
extern void DISK_select(byte data);
extern void DISK_select_set(byte data);
extern byte DISK_status();
extern void disk_eject(int num);
extern int disk_empty(int num);
extern void disk_insert(int num, const TCHAR* name);
extern void disk_insert_force(int num, const TCHAR* name, bool writeprotected);
extern void DISK_vsync();
extern int DISK_validate_filename(const TCHAR* fname, int leave_open, bool* wrprot, uint* crc32, struct zfile** zf);
extern void DISK_handler(uint);
extern void DISK_update(int hpos);
extern void DISK_update_adkcon(int hpos, ushort v);
extern void DISK_hsync();
extern void DISK_reset();
extern int disk_getwriteprotect(const TCHAR* name);
extern int disk_setwriteprotect(int num, const TCHAR* name, bool writeprotected);
extern void disk_creatediskfile(const TCHAR* name, int type, drive_type adftype, const TCHAR* disk_name, bool ffs, bool bootable);
extern void dumpdisk();
extern int DISK_history_add(const TCHAR* name, int idx, int type, int donotcheck);
extern TCHAR* DISK_history_get(int idx, int type);
int DISK_examine_image(CConfiguration* conf, int num, uint* crc32);
extern TCHAR* DISK_get_saveimagepath(const TCHAR* name);
extern void DISK_reinsert(int num);
extern int disk_prevnext(int drive, int dir);
extern int disk_prevnext_name(TCHAR* img, int dir);
extern void DSKLEN(ushort v, int hpos);
extern ushort DSKBYTR(int hpos);
extern void DSKSYNC(int, ushort);
extern void DSKPTL(ushort);
extern void DSKPTH(ushort);
extern void DSKDAT(ushort);
extern ushort DSKDATR();
extern ushort disk_dmal();
extern uae_ptr disk_getpt();
extern int disk_fifostatus();
// extern int disk_debug_logging; -> Logging::FDD_DEBUG
// extern int disk_debug_mode; -> not used
// extern int disk_debug_track; -> not used

#define DISK_DEBUG_DMA_READ 1
#define DISK_DEBUG_DMA_WRITE 2
#define DISK_DEBUG_PIO 4

#define MAX_PREVIOUS_FLOPPIES 99